@import './element-variables.2.11.scss';
@import './custom-variables.1.7.scss';


/* 非官方element组件和页面中的DOM模板
   ----------------
   | versions.1.7 |
   | 2019/08/06   |
   | EPM体验设计部 |
   ----------------

   1. 除ElementUI组件外以模块为单位的样式定义;
   2. 类名以template单词开头与ElementUI组件和其他个性化功能区分;
   3. 每项模板增加了DOM结构;
   4. 工具适用于所有项目或各功能;
--------------------------------------------------------------*/

/*
  初始化定义图标等html标签
-----------------------------*/ 
* {
  margin:0;
  padding:0;
}

li,
ul {
list-style: none;
}

.icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  fill: currentColor;
  overflow: hidden;
}


/* 初始化定义全局滚动条 (支持webkeit内核浏览器)
--------------------------------------------- */
::-webkit-scrollbar {
  background-color:#e7e8ed; 
  width:14px; 
  height:14px;
  -webkit-transition: opacity 340ms ease-out; 
  transition: opacity 340ms ease-out; 
  &:hover,
  &:active {
      background-color:#e7e8ed; 
  }
}
::-webkit-scrollbar-thumb{ 
  background-color: #b5b9ca;
  border:1px solid #e7e8ed;
  -webkit-transition: .3s background-color;
  transition: .3s background-color;
  background-clip:padding-box; 
  min-height:15px;
  border-radius:2px;
  &:hover,
  &:active{ 
      background-color:#9194a2;
  }
}
::-webkit-scrollbar-button{
  height:0; 
  width:0;
}
::-webkit-scrollbar-track{
  background-clip:padding-box;
}
::-webkit-scrollbar-corner{
  background:transparent;
}


/* ## 工具
------------------------------*/

// 文本颜色 （适用范围：覆盖全部界面中特殊颜色的文本）
.template-font-color-primary {
  color: $--color-primary;
}

.template-font-color-warning {
  color: $--color-warning;
}

.template-font-color-success {
  color: $--color-success-color-1;
}

.template-font-color-danger {
  color: $--color-danger;
}

// el-button组件为text类型且有功能颜色区分的 （适用范围：表格内操作列及个性化或非UI规则使用）
.template-button-text-info {
  color: $--color-template-button-text-primary;
  &:focus,
  &:hover {
    color:$--color-template-button-text-primary;
  }
}

.template-button-text-primary {
  color: $--color-primary;
}

.template-button-text-success {
  color: $--color-success-color-1;
  &:focus,
  &:hover {
    color: $--color-success-color-1;
  }
}

.template-button-text-warning {
  color: $--color-warning;
}

.template-button-text-danger {
  color: $--color-danger;
  &:focus,
  &:hover {
    color:$--color-danger;
  }
}

.template-text-info {
  color: $--color-text-secondary;
}

// 文本对齐方式 （适用范围：个性化或非UI规则对齐方式使用）
.text-right {
  text-align: right !important
}

.text-center {
  text-align: center !important;
}


/* ## 查询表格界面模板 ( 从UI设计规范来分析主要包括：头部 | 主体容器 )
 *
 * ### DOM结构
 *
<div class="template-table-list-wrapper">
    <div class="template-table-list-header">
        <!-- 查询表格顶部 -->
    </div>
    <div class="template-table-list-body">
        <!-- 查询表格主体 -->
    </div>
</div>
------------------------------------------------- */
.template-table-list-wrapper {

  // 查询列表-查询列表头部 ( 从UI设计规范来分析主要包括：标题 | 视图切换 )
  .template-table-list-header {
      display: flex;
      margin-bottom:20px;

      // 标题为默认h3标签
      h3 {
        margin:0;
        color: $--color-template-button-text-primary;
        font-weight: normal;
        font-size: 18px;
      }

      // 控制切换视图功能在右侧
      .template-switch-view-group {
        margin-left:auto;
      }
  }

  // 查询列表-主体 （ 从UI设计规范来分析主要包括：工具栏 | 表格 | 分页 ）
  .template-table-list-body {
    box-sizing: border-box;
    height: calc(100vh - 188px); // 此高度跟随门户菜单形式调整
    border: 1px solid #ebeef3;
    border-radius: 4px;
    box-sizing: border-box;
    padding: 20px;
    background-color: $--color-white;

    &.small {
      height: calc(100vh - 238px);
    }
  }
}


/* ## 查询列表-切换视图 (非ElementUI官方Radio.Group组件)
 *
 * ### DOM结构
 *
<div class="template-switch-view-group">
    <el-tooltip content="列表"  placement="bottom-end">
      <el-button>
        <i class="iconfont"></i>
      </el-button>
    </el-tooltip>
    <el-tooltip content="平铺" placement="bottom-end">
      <el-button>
        <i class="iconfont"></i>
      </el-button>
    </el-tooltip>
</div>
---------------------------------------------------------*/
.template-switch-view-group {
  .el-button {
    display: inline-block;
    margin: 0;
    padding: 0;
    height: 24px;
    width: 31px;
    min-width: unset;
    border-radius: 4px;
    text-align: center;
    &:first-child {
      margin-left: -5px;
      border-top-right-radius: 0;
      border-bottom-right-radius: 0;
    }
    &:last-child {
      margin-left: -5px;
      border-top-left-radius: 0;
      border-bottom-left-radius: 0;
    }
  }
  .orange-item,
  .green-item {
    i {
      color: $--color-white;
    }
  }
  .orange-item {
    background: $--color-warning;
    border: 1px solid transparent;
  }
  .green-item {
    border: 1px solid transparent;
    background: $--color-success;
  }
}


/* ## 查询列表-工具栏 （ 从UI设计规范来分析主要包括：操作按钮组 | 筛选 | 查询 | 高级查询弹层 , 其中操作按钮组和查询表单在custom-components中已定义 ）
 *
 * ### DOM结构
 *
<div class="template-toolbar-group">
  <div class="item-left">
  </div>
  <div class="item-right">
  </div>
</div>
------------------------------------------*/
.template-toolbar-group {
  display: flex;
  align-items:flex-end;
  margin-bottom:20px;
  .item-left {
    width:inherit;
  }

  .item-right {
    margin-left: auto;
  }
}

/* ## 查询列表-筛选
 *
 * ### DOM结构
 *
<dl class="template-filter-group vertical">
  <dt>title：</dt>
  <dd>
      <a href="javascript:void(0);" :class="{'is-active':true}">item-one</a>
  </dd>
  <dd>
      <a href="javascript:void(0);" :class="{'is-active':false}">item-two</a>
  </dd>
</dl>
------------------------------------------------------------------------------ */
.template-filter-group {
  display: inline-flex;
  margin:0 0 0 30px;
  padding:0;
  line-height:30px;
  font-size: $--font-size-small;

  &.vertical { // 纵向排版中使用
    display:flex;
    margin:0 0 10px 0;
  }

  dt {
    margin: 0 -14px 0 0;
    color: $--color-template-button-text-primary;
  }

  dd {
    margin: 0 0 0 20px;
  }

  a { // 每项的索引状态
    color: #868cb5;
    text-decoration: none;

    &:hover,
    &.is-active {
      padding-bottom:8px;
      border-radius: 0;
      border-bottom: 1px solid $--color-primary;
      color: $--color-primary
    }
  }
}


/* ## 高级查询 （默认为4列，内部每项采用栅格化布局并且兼容1366px*768px分辨率）
 *
 * ### DOM结构
 *
  <el-button class="template-advanced-query-toogle" size="small" type="text" @click="togglePopup()">&lt; 高级筛选</el-button>
  <transition name="el-zoom-in-top">
    <div class="template-advanced-query-popup" v-show="isDisPlayAdvancedPopup">
      <el-row>
        <el-col :lg="12" :xl="8">
          <label>label-one：</label>
          <el-input placeholder="请输入内容" />
        </el-col>
        <el-col :lg="8" :xl="6">
          <label>label-two：</label>
          <el-input placeholder="请输入内容" />
        </el-col>
      </el-row>
      <div class="button-group">
        <el-button size="small">取消</el-button>
        <el-button size="small" type="primary">确定</el-button>
        <el-button size="small" type="primary" plain>重置</el-button>
      </div>
    </div>
  </transition>

  togglePopup: function() {
      this.isDisPlayAdvancedPopup = !this.isDisPlayAdvancedPopup;
  }
-------------------------------------------------------- */

.template-advanced-query-toogle {
  &.el-button--small {
    min-width: unset;
  }
}
.template-advanced-query-popup {
  position: absolute;
  top: 136px;
  left: 21px;
  right: 21px;
  z-index: 99;
  padding: 20px;
  background-color: #fff;
  border-top: 1px solid $--border-color-base;
  border-bottom: 1px solid $--border-color-base;
  box-shadow: 0 2px 3px rgba($color: #000, $alpha: .05);
  .el-col {
    display: inline-flex;
    margin-bottom:20px;
    label {
      padding-right:6px;
      color:$--color-text-grade-1;
    }
  }
  .button-group {
    padding-top:20px;
    border-top: 1px solid $--border-color-base;
    text-align: right;
  }
}

.template-card-list-wrapper {
  .template-card-list-body {
    display: flex;
    justify-content: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0;
    margin: 0 -2%;

    //新建页面
    .empty {
      .item-info {
        width: 100%;
        min-height: 198px;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column
      }

      svg {
        margin: 15px 0;
      }

      a {
        display: block;
        height: 100%;
        border: 1px solid transparent;
        text-decoration: none;
        color: $--color-primary;
        font-size: $--font-size-base;
      }

      a:hover {
        border: 1px solid$--color-primary;
        background: $--color-primary-color-3
      }
    }

    li {
      position: relative;
      width: 16%;
      margin: 0 2% 40px 2%;
      box-shadow: 0 0 8px rgba(0, 0, 0, 0.12);
      img {
        width: 100%;
        height: 150px;
      }
      &:hover {
        .item-opts {
          display: block;
        }
      }

      .item-info {
        position: relative;
        //已上架 已下架
        .upper-shelf,
        .lower-shelf {
          position: absolute;
          left: 5%;
          top: 0;
          padding: 3px 10px;
          border-bottom-left-radius: 5px;
          border-bottom-right-radius: 5px;
          color: $--color-white;
        }

        .upper-shelf {
          background: $--color-primary;
        }

        .lower-shelf {
          background: $--color-warning;
        }

        .list-item-bom {
          margin-top: -4px;
          padding: 0 10px 10px 10px;
          box-shadow: 0 0 10px $--color-grayish-3;

          p {
            margin: 0;
            padding: 8px 0 15px 0;
            width: 98%;
            overflow: hidden;
            color: $--color-blue-light-1;
            text-overflow: ellipsis;
            white-space: nowrap;
          }

          span {
            display: inline-block;
            padding: 3px 8px;
            border-radius: 3px;
          }

        }
      }

      .item-opts {
        display: none;
        position: absolute;
        top: 0;
        left: 0;
        z-index: 1;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.6);
        &.other {
          .el-switch {
            .el-switch__core {
              &::before {
                content: "私有" !important;
              }
            }

            &.is-checked {
              .el-switch__core {
                &::before {
                  content: "公有" !important;
                }
              }
            }
          }
        }

        .el-switch {
          position: absolute;
          top: 13px;
          right: 15px;
          z-index: 99;
        }

        .el-switch .el-switch__core {
          width: 58px !important;
          height: 22px !important;
        }

        .el-switch__core {
          border-color: $--color-warning !important;
          background: $--color-warning !important;

          &::before {
            content: "下架";
            display: inline-block;
            width: 100%;
            height: 22px;
            color: $--color-white;
            font-size: $--font-size-small;
            text-align: right;
            position: relative;
            right: 8px;
            font-size: $--font-size-small;
            line-height: 22px;

          }
        }

        .is-checked {
          .el-switch__core {
            border-color: $--color-primary !important;
            background: $--color-primary !important;

            &::before {
              content: "上架";
              text-align: left;
              padding: 0 0 0 18px;

            }
          }
        }

        .el-switch__core:after {
          width: 22px;
          height: 22px;
        }

      }

      //预览和生成模板按钮
      .item-opt-one {
        position: absolute;
        top: 10%;
        width: 100%;
        height: 80%;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        .el-button {
          width: 60%;
          margin: 0 0 20px 0;
          color: $--color-white
        }

        .page-preview {
          border-color: $--color-success-color-1;
          background: $--color-success-color-1
        }

        .page-preview:hover {
          border-color: $--color-success-hover-color-1;
          background: $--color-success-hover-color-1
        }

        .generate-template {
          border-color: $--color-primary;
          background: $--color-primary
        }

        .generate-template:hover {
          border-color: $--color-primary;
          background: $--color-primary
        }
      }

      .item-opt-two {
        position: absolute;
        bottom: 10%;
        left: 0;
        width: 100%;
        display: flex;
        justify-content: center;
        flex-direction: row;

        a {
          width: 30px;
          height: 30px;
          margin: 0 5%;
          display: inline-block;
          border-radius: 20px;
          background: $--color-white;
          line-height: 30px;
          text-align: center;

          .icon-delete {
            font-size: $--font-size-small;
            color: $--color-danger
          }
        }
      }
    }

    .group-status {
      display: flex;
      justify-content: space-between;
    }
  }
  .template-card-list-footer {
    width: 145px;
    margin: 0 auto 32px auto;
    .el-button {
      padding: 7px 40px;
      background: $--color-grayish-1;
      border-color: $--border-color-base;
      color: $--color-blue-light-1;
      font-size: $--font-size-small;
    }
    .el-button:hover {
      background: $--color-primary-color-3;
      border-color: $--color-primary-color-2;
    }
    svg {
      width: 0.8em;
      height: 0.8em;
    }
  }
}


/* ## 信息标签 ( 适用范围：项目所有涉猎 )
 *
 * ### DOM结构
 *
  <el-tag class="template-info-group">
    <svg class="icon" aria-hidden="true">
      <use xlink:href="#icon-info"></use>
    </svg>
    共搜索到<span>{{totalCount}}</span>条
  </el-tag>
----------------------------------------------*/
.template-info-group {
  margin-top:10px;
  padding:0 20px;
  > span {
    padding:0 10px 6px;
  }
  > .icon {
    margin-right:8px;
    transform: scale(1.2);
    vertical-align: middle;
    fill: currentColor;
  }
}

/* ## 含表单对话框
 *
 * ### DOM结构
 *
  <el-dialog class="template-dialog" title="标题">
      <el-form :model="form">
          <el-form-item label="表单项1：">
              <el-input disabled></el-input>
          </el-form-item>
          <el-form-item label="表单项2：">
              <el-input placeholder="请输入名称"></el-input>
          </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
          <el-button>取 消</el-button>
          <el-button type="primary">确 认</el-button>
      </div>
  </el-dialog>

----------------------------------------------*/
// :append-to-body="false"
// :modal-append-to-body="false"
// :modal="true"
//不要插到body标签并且设置遮罩层是true
.template-dialog{ //可移动，不可点击其他内容部分（背景透明），
  .el-dialog {
    box-shadow: 0 0 5px rgba($color: #666, $alpha: .4)
  }
  + .v-modal { 
    opacity: 1;
    background-color:transparent;
  }
  // 无遮罩层
  &.template-dialog__no-modal {
    .el-dialog{
      border:1px solid #e5e7ef;
      box-shadow: 0 0 5px rgba($color: #666, $alpha: .4)
    }
  }
  //头部
  .el-dialog__header{
    .el-dialog__title{
      font-size: 16px;
    }
  }
  //主体
  .el-dialog__body{

    padding: 20px 35px;

    .el-form{
      .el-form-item {
        margin-bottom: 15px;
      }
    }
  }

  //底部
  .el-dialog__footer{
    text-align: center;
  }
}
